Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Color Mix #1109

Merged
merged 4 commits into from
Dec 13, 2024
Merged

CSS Color Mix #1109

merged 4 commits into from
Dec 13, 2024

Conversation

lukasoppermann
Copy link
Contributor

@lukasoppermann lukasoppermann commented Dec 6, 2024

Summary

This transformer allows us to use css variables in our output even when we change the alpha value of our tokens.

Before After
--[token-name]: #0000008C --[token-name]: color-mix(in srgb, var(--[refernces-token]), 45% transparent)
No reference to the original token is kept the original token is still referenced var(--[refernces-token])

Impact

Any reference that is in the css of github.com can easily be overwritten by user settings. Keeping references allows us to let users change role colors, e.g. the color for success and it gets inherited in all places where this is used, even if it is used within another token.

Risk

Our support matrix includes Safari 16.0 and 16.1 which do not support color-mix.

If by the time this is released, we still have to support them (it is already a very small amount), we can use an @supports block. However, this would increase our css file size.

Copy link

changeset-bot bot commented Dec 9, 2024

🦋 Changeset detected

Latest commit: fded1fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/primitives Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 9, 2024 11:52 Inactive
@lukasoppermann lukasoppermann self-assigned this Dec 10, 2024
@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 10, 2024 12:15 Inactive
@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 10, 2024 12:17 Inactive
@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 10, 2024 12:42 Inactive
@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 10, 2024 13:03 Inactive
@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 12, 2024 18:15 Inactive
@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 12, 2024 21:19 Inactive
@lukasoppermann lukasoppermann marked this pull request as ready for review December 13, 2024 08:06
@lukasoppermann lukasoppermann requested review from a team as code owners December 13, 2024 08:06
@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 13, 2024 08:11 Inactive
@github-actions github-actions bot temporarily deployed to Preview (Storybook) December 13, 2024 08:47 Inactive
@lukasoppermann lukasoppermann merged commit da8a1d9 into main Dec 13, 2024
27 checks passed
@lukasoppermann lukasoppermann deleted the css-transparent-color branch December 13, 2024 08:59
@primer primer bot mentioned this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant